package com.maykk.Demo08;

/**
 * 构造方法测试
 */
public class Person {
    private String name;
    private int age;


    Person() {
        System.out.println("我是无参构造方法~");
    }

    Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void getInfo() {
        System.out.println(name + "，" + age);
    }

    @Override
    public String toString() {
        return "Person{" + "name='" + name + '\'' + ", age=" + age + '}';
    }
}
